<extend name="./public/frame.html"/>
<block name="content">
    <div class="layui-collapse" lay-filter="driver">
        <div class="layui-colla-item">
            <h2 class="layui-colla-title" data-v="driver">路线信息</h2>
            <div class="layui-colla-content layui-show">
                <table class="layui-table">

                        <tr>
                            <td  style="width: 10%">出发地</td>
                            <td>{$routeInfo.route_start_city_name}</td>
                        </tr>
                    <tr>
                        <td  style="width: 10%">目的地</td>
                        <td>{$routeInfo.route_end_city_name}</td>
                    </tr>
                    <tr>
                        <td  style="width: 10%">司机姓名</td>
                        <td>{$routeInfo.driver_name}</td>
                    </tr>
                    <tr>
                        <td  style="width: 10%">手机号码</td>
                        <td>{$routeInfo.driver_phone}</td>
                    </tr>
                    <tr>
                        <td  style="width: 10%">所属运力</td>
                        <td>{$routeInfo.their_name}</td>
                    </tr>
                    <tr><td  style="width: 10%">路线价格(元)</td><td>{$routeInfo.route_price}</td></tr>
                    <tr><td  style="width: 10%">路线时间</td><td>{$routeInfo.route_time}</td></tr>
                    <tr><td  style="width: 10%">路线状态</td><td>{$routeInfo.route_status}</td></tr>
                    <tr><td  style="width: 10%">创建时间</td><td>{$routeInfo.create_time}</td></tr>


                </table>
            </div>
        </div>

    </div>

    <script>
        layui.use(['layer','element'], function(){
            var layer = layui.layer;
            var element = layui.element;
            layer.photos({
                photos: '.layer-photos-demo'
                ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
                ,tab: function(pic, layero){
                    var str = "<div style='text-align: center'>"+pic.alt+"</div>";
                    layero.prepend(str);
                }
            });
            var $ = layui.jquery;
            element.on('collapse(driver)', function(data){
                var title = data.title;
                switch (title.data('v')){
                    case 'car':
                        if(title.data('act')=='no'){
                            title.data('act','yes');
                            $.post('/admin/driver/carInfo',{driver_id:title.data('value')},function (res) {
                                switch (res['status']){
                                    case 1:
                                        data.content.html(res['html']);
                                        break;
                                    default:
                                        layer.alert(res['msg'],{icon: 5});
                                        break;
                                }
                            },'json')
                        }
                        break;
                    case 'auth':
                        if(title.data('act')=='no'){
                            title.data('act','yes');
                            $.post('/admin/driver/authInfo',{driver_id:title.data('value')},function (res) {
                                switch (res['status']){
                                    case 1:
                                        data.content.html(res['html']);
                                        break;
                                    default:
                                        layer.alert(res['msg'],{icon: 5});
                                        break;
                                }
                            },'json')
                        }
                    default:
                        break;
                }
            });
        });
    </script>
</block>